﻿<div class="current-location">
    <ul>
        <li class="left"><i class="glyphicon glyphicon-home"></i><a href="javascript:void(0)" onclick="location.href=location.href">用户系统设置</a></li>
        <li class="right"><a href="javascript:void(0)" onclick="LoadData()" title="刷新"><span class="glyphicon glyphicon-refresh"></span></a></li>
    </ul>
</div>

<div class="main">
    <form method="post" id="_form" class=" form form-group-sm form-lg ui-validForm">

        <div class="tabcontent" data-tab-params="tabName:'用户登录设置'" id="loginTab" data-source="@ViewBag.LoginConfig">
            <div class="form-group">
                <label class="control-label">登录功能</label>
                <div class="controls form-inline">
                    <label class="radio-inline">
                        <input class="ui-show-hide" type="radio" name="Login_Open" id="Login_Open" value="1" checked showObjs="#Login_Set">开启
                    </label>
                    <label class="radio-inline">
                        <input class="ui-show-hide" type="radio" name="Login_Open" id="Login_Open" value="0" hideObjs="#Login_Set">关闭
                    </label>
                    <span class="help-block"></span>
                </div>
            </div>

            <div id="Login_Set">
                <div class="form-group">
                    <label class="control-label">登录方式</label>
                    <div class="controls form-inline">
                        <label class="checkbox-inline">
                            <input type="checkbox" name="Login_LoginType" id="Login_LoginType" value="username" checked>用户名+密码
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" name="Login_LoginType" id="Login_LoginType" value="email">邮箱+密码
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox" name="Login_LoginType" id="Login_LoginType" value="mobile">手机+密码
                        </label>
                        <span class="help-block">邮箱和手机必须经过验证后才能用于账号登录。</span>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label">图片验证码</label>
                    <div class="controls form-inline">
                        <label class="radio-inline">
                            <input type="radio" name="Login_VerificationCode" id="Login_VerificationCode" value="1" checked>开启
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="Login_VerificationCode" id="Login_VerificationCode" value="0">关闭
                        </label>
   
                        <span class="help-block"></span>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label">登录成功</label>
                    <div class="controls form-inline">
                        <label class="checkbox-inline">
                            <input class="ui-show-hide" type="checkbox" name="Login_SendEmail" id="Login_SendEmail" value="1" showObjs="#Login_emailSet" />发送邮件通知
                        </label>
                        <label class="checkbox-inline">
                            <input class="ui-show-hide" type="checkbox" name="Login_SendSms" id="Login_SendSms" value="1" showObjs="#Login_smsSet">发送短信通知
                        </label>
                        <span class="help-block"></span>
                    </div>
                </div>

                <div class="form-group" id="Login_emailSet">
                    <label class="control-label">通知邮件设置</label>
                    <div class="controls">
                        <div style="margin-bottom:5px">
                            <input type="text" class="form-control" name="Login_EmailTitle" id="Login_EmailTitle" />
                            <span class="help-block">通知邮件标题</span>
                        </div>
                        <div>
                            <textarea class="form-control" name="Login_EmailContent" id="Login_EmailContent"></textarea>
                            <span class="help-block">通知邮件内容,占位符${username}表示当前用户名</span>
                        </div>
                    </div>
                </div>

                <div class="form-group" id="Login_smsSet">
                    <label class="control-label">通知短信模板编号</label>
                    <div class="controls">
                        <input type="text" class="form-control" name="Login_SmsTemplateCode" id="Login_SmsTemplateCode" />
                        <span class="help-block">模板编号在接口提供商处设置并获取，模板占位符${username}表示当前用户名</span>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label">允许登录的用户组</label>
                    <div class="controls">
                        <select id="Login_MemberGroupIds" name="Login_MemberGroupIds" class="form-control ui-convertData multiple-select" multiple style="display:block;height:120px;" data-custom-params="url:'@Url.ActionUrl("LoadListByIds","MemberGroup")',textField:'Name'"></select>
                        <div class="btn-group btn-group-sm">
                            <a href="javascript:void(0)" class="btn btn-default btn-sm ui-dialog" data-custom-params="title:'选择用户组',url:'@Url.ActionUrl("Select","MemberGroup")?objname=#Login_MemberGroupIds',width:'80%',height:'90%',target:'self'">选择用户组</a>
                            <a href="javascript:void(0)" class="btn btn-default btn-sm ui-removeSelectedOptions" title="按住Ctrl键可实现多选" data-custom-params="obj:'#Login_MemberGroupIds'">删除选中</a>
                        </div>
                        <input type="hidden" name="Login_MemberGroupIds" />
                        <span class="help-block">不选择则不进行用户组限制</span>
                    </div>
                </div>


                <div class="form-group">
                    <label class="control-label">允许登录的部门</label>
                    <div class="controls">
                        <select id="Login_DepartmentIds" name="Login_DepartmentIds" class="form-control ui-convertData  multiple-select" multiple style="display:block;height:120px;" data-custom-params="url:'@Url.ActionUrl("LoadListByIds","Department")',textField:'Name',onlySelectFinal:true"></select>
                        <div class="btn-group btn-group-sm">
                            <a href="javascript:void(0)" class="btn btn-default btn-sm ui-dialog" data-custom-params="title:'选择用户组',url:'@Url.ActionUrl("Select","Department")?objname=#Login_DepartmentIds',width:'80%',height:'90%',target:'self'">选择部门</a>
                            <a href="javascript:void(0)" class="btn btn-default btn-sm ui-removeSelectedOptions" title="按住Ctrl键可实现多选" data-custom-params="obj:'#Login_DepartmentIds'">删除选中</a>
                        </div>
                        <input type="hidden" name="Login_DepartmentIds" />
                        <span class="help-block">不选择则不进行部门限制</span>
                    </div>
                </div>
            </div>
        </div>


        <div class="tabcontent" data-tab-params="tabName:'用户注册设置'" id="regTab" data-source="@ViewBag.RegConfig">
            <div class="form-group">
                <label class="control-label">注册功能</label>
                <div class="controls form-inline">
                    <label class="radio-inline">
                        <input class="ui-show-hide" type="radio" name="Reg_Open" id="Reg_Open" value="1" checked showObjs="#Reg_Set">开启
                    </label>
                    <label class="radio-inline">
                        <input class="ui-show-hide" type="radio" name="Reg_Open" id="Reg_Open" value="0" hideObjs="#Reg_Set">关闭
                    </label>
                    <span class="help-block"></span>
                </div>
            </div>

            <div id="Reg_Set">
                <div class="form-group">
                    <label class="control-label">注册默认用户组</label>
                    <div class="controls">
                        <select id="Reg_DefaultMemberGroupId" name="Reg_DefaultMemberGroupId" class="form-control" data-source="@Html.GetMemberGroupListJson(c=>c.CanReg==1)">
                            <option value="0">请选择默认注册用户组</option>
                        </select>
                        <span class="help-block"></span>
                    </div>
                    <script type="text/javascript">
                        $("#Reg_DefaultMemberGroupId").SelectBind({ dataSourceFrom: "attr", textField: "Name", valueField: "Id" });
                    </script>
                </div>

                <div class="form-group">
                    <label class="control-label">手机表单设置</label>
                    <div class="controls form-inline">
                        <label class="radio-inline">
                            <input type="radio" name="Reg_MobileFieldSet" id="Reg_MobileFieldSet" value="0" checked />隐藏
                        </label>

                        <label class="radio-inline">
                            <input type="radio" name="Reg_MobileFieldSet" id="Reg_MobileFieldSet" value="1">必填
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="Reg_MobileFieldSet" id="Reg_MobileFieldSet" value="2">必填+手机验证码验证
                        </label>
                        <span class="help-block"></span>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label">手机唯一性检测</label>
                    <div class="controls form-inline">
                        <label class="radio-inline">
                            <input type="radio" name="Reg_MobileOnlyOne" id="Reg_MobileOnlyOne" value="1" checked />是
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="Reg_MobileOnlyOne" id="Reg_MobileOnlyOne" value="0" />否
                        </label>
                        <span class="help-block">如果选择是，则一个手机只能注册一次</span>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label">邮箱表单设置</label>
                    <div class="controls radio">
                        <label class="radio-inline">
                            <input type="radio" name="Reg_EmailFieldSet" id="Reg_EmailFieldSet" value="0" checked />隐藏
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="Reg_EmailFieldSet" id="Reg_EmailFieldSet" value="1">必填
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="Reg_EmailFieldSet" id="Reg_EmailFieldSet" value="2">必填+邮件验证码验证
                        </label>
                        <span class="help-block"></span>
                    </div>
                </div>


                <div class="form-group">
                    <label class="control-label">邮箱唯一性检测</label>
                    <div class="controls form-inline">
                        <label class="radio-inline">
                            <input type="radio" name="Reg_EmailOnlyOne" id="Reg_EmailOnlyOne" value="1" checked />是
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="Reg_EmailOnlyOne" id="Reg_EmailOnlyOne" value="0" />否
                        </label>
                        <span class="help-block">如果选择是，则一个邮箱只能注册一次</span>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label">显示自定义字段</label>
                    <div class="controls radio">
                        <label class="radio-inline">
                            <input type="radio" name="Reg_ShowCustomField" id="Reg_ShowCustomField" value="0" checked hideObjs="#Reg_VerificationCodeEmailSet">否
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="Reg_ShowCustomField" id="Reg_ShowCustomField" value="1" hideObjs="#Reg_VerificationCodeEmailSet">是
                        </label>
                        <span class="help-block">自定义字段在系统管理>表>系统表>查找pa_member,在字段管理中设置</span>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label">注册后状态</label>

                    <div class="controls form-inline">
                        <label class="radio-inline">
                            <input type="radio" name="Reg_DefaultState" id="Reg_DefaultState" value="1" checked>通过审核
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="Reg_DefaultState" id="Reg_DefaultState" value="0" />需后台人工审核
                        </label>
                        <span class="help-block"></span>
                    </div>

                </div>

                <div class="form-group">
                    <label class="control-label">图片验证码</label>
                    <div class="controls form-inline">
                        <label class="radio-inline">
                            <input type="radio" name="Reg_VerificationCode" id="Reg_VerificationCode" value="1" checked>开启
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="Reg_VerificationCode" id="Reg_VerificationCode" value="0">关闭
                        </label>
                        <span class="help-block"></span>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label">注册成功通知</label>
                    <div class="controls form-inline">
                        <label class="checkbox-inline">
                            <input class="ui-show-hide" type="checkbox" name="Reg_SendEmail" id="Reg_SendEmail" value="1" showObjs="#Reg_EmailSet" />发送邮件通知
                        </label>
                        <label class="checkbox-inline">
                            <input class="ui-show-hide" type="checkbox" name="Reg_SendSms" id="Reg_SendSms" value="1" showObjs="#Reg_SmsSet">发送短信通知
                        </label>
                        <span class="help-block"></span>
                    </div>
                </div>

                <div class="form-group" id="Reg_EmailSet">
                    <label class="control-label">通知邮件设置</label>
                    <div class="controls">
                        <div style="margin-bottom:5px">
                            <input type="text" class="form-control" name="Reg_EmailTitle" id="Reg_EmailTitle" />
                            <span class="help-block">通知邮件标题</span>
                        </div>
                        <div>
                            <textarea class="form-control" name="Reg_EmailContent" id="Reg_EmailContent" style="height:150px"></textarea>
                            <span class="help-block">通知邮件内容，占位符${username}表示注册用户，${password}表示密码</span>
                        </div>
                    </div>
                </div>
                <div class="form-group" id="Reg_SmsSet">
                    <label class="control-label">通知短信模板编号</label>
                    <div class="controls">
                        <input type="text" class="form-control" name="Reg_SmsTemplateCode" id="Reg_SmsTemplateCode" />
                        <span class="help-block">填写模板编号，模板占位符${username}表示注册用户，${password}表示密码。</span>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label class="control-label">注册协议设置</label>
                <div class="controls">
                    <button type="button" class="btn btn-sm btn-default ui-dialog" data-custom-params="title:'注册协议设置',url:'@Url.ActionUrl("RegAgreement")'">设置用户注册协议</button>
                    <span class="help-block"></span>
                </div>
            </div>
        </div>

        <div class="tabcontent" data-tab-params="tabName:'找回密码设置'" id="findPassTab" data-source="@ViewBag.FindPassConfig">
            <div class="form-group">
                <label class="control-label">找回密码功能</label>
                <div class="controls radio">
                    <label class="radio-inline">
                        <input class="ui-show-hide" type="radio" name="FindPassword_Open" id="FindPassword_Open" value="1" checked showObjs="#FindPassword_Set" />开启
                    </label>
                    <label class="radio-inline">
                        <input class="ui-show-hide" type="radio" name="FindPassword_Open" id="FindPassword_Open" value="0" hideObjs="#FindPassword_Set">关闭
                    </label>
                    <span class="help-block"></span>
                </div>
            </div>

            <div id="FindPassword_Set">

                <div class="form-group">
                    <label class="control-label">密码找回方式</label>
                    <div class="controls checkbox">
                        <label class="checkbox-inline">
                            <input class="ui-show-hide" type="checkbox" name="FindPassword_FindByEmail" id="FindPassword_FindByEmail" value="1" showObjs="#FindPassword_EmailSet" checked />通过邮箱找回
                        </label>
                        <label class="checkbox-inline">
                            <input class="ui-show-hide" type="checkbox" name="FindPassword_FindByMobile" id="FindPassword_FindByMobile" value="1" showObjs="#FindPassword_SmsSet" checked />通过手机短信找回
                        </label>
                        <span class="help-block">将通过发送验证码的方式对邮箱或手机号进行所有权验证</span>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label">图片验证码</label>
                    <div class="controls radio">
                        <label class="radio-inline">
                            <input type="radio" name="FindPassword_VerificationCode" id="FindPassword_VerificationCode" value="1" checked>开启
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="FindPassword_VerificationCode" id="FindPassword_VerificationCode" value="0">关闭
                        </label>
                        <span class="help-block"></span>
                    </div>
                </div>
            </div>
        </div>

        <div class="tabcontent" data-tab-params="tabName:'用户中心设置'" id="findPassTab">
            <div id="memberCenterConfig" data-source="@ViewBag.MemberCenterConfig">
                <div class="form-group">
                    <label class="control-label">用户中心首页链接地址</label>
                    <div class="controls form-inline">
                        <input type="text" class="form-control form-control-md" name="MemberCenter_HomeLink" id="MemberCenter_HomeLink" />
                        <span class="help-block">用户中心返回首页的链接地址，不设置则默认系统绑定的主域名</span>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label">是否允许修改用户名</label>
                    <div class="controls form-inline">
                        <select name="MemberCenter_CanModifyUsername" id="MemberCenter_CanModifyUsername" class="form-control form-control-sm">
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                        <span class="help-block">如果没有必须的需求，建议不要开启，避免信息表之类用户名混乱</span>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label">登录是否需要完善资料</label>
                    <div class="controls form-inline">
                        <select name="MemberCenter_LoginedMustFillInformation" id="MemberCenter_LoginedMustFillInformation" class="form-control form-control-sm">
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                        <span class="help-block">设置为是后，用户登录后将强制到资料页面完善资料。</span>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label">用户中心公告栏目</label>
                    <div class="controls form-inline">
                        <div class="input-group">
                            <select name="MemberCenter_NoticeColumnId" id="MemberCenter_NoticeColumnId" class="form-control form-control-sm ui-convertData" data-custom-params="url:'@Url.ActionUrl("LoadListByIds","Column")',textField:'Name'">
                                <option value="0">未设置</option>
                            </select>
                            <span class="input-group-btn">
                                <button type="button" class="btn btn-sm btn-default ui-dialog" data-custom-params="title:'选择公告栏目',url:'@Url.ActionUrl("Select","Column")?objname=#MemberCenter_NoticeColumnId',width:'600px',height:'90%',target:'_self'">选择栏目</button>
                            </span>
                        </div>
                        <span class="help-block">用户中心首页显示</span>
                    </div>
                </div>
            </div>

            <div class="form-group" id="adminCenterConfig" data-source="@ViewBag.AdminCenterConfig">
                <label class="control-label">管理中心公告栏目</label>
                <div class="controls form-inline">
                    <div class="input-group">
                        <select name="AdminCenter_NoticeColumnId" id="AdminCenter_NoticeColumnId" class="form-control form-control-sm ui-convertData" data-custom-params="url:'@Url.ActionUrl("LoadListByIds","Column")',textField:'Name'">
                            <option value="0">未设置</option>
                        </select>
                        <span class="input-group-btn">
                            <button type="button" class="btn btn-sm btn-default ui-dialog" data-custom-params="title:'选择公告栏目',url:'@Url.ActionUrl("Select","Column")?objname=#AdminCenter_NoticeColumnId',width:'600px',height:'90%',target:'_self'">选择栏目</button>
                        </span>
                    </div>
                    <span class="help-block">后台管理首页显示</span>
                </div>
            </div>
        </div>

        <div class="submit-footerbar">
            <label class="control-label"></label>
            <div class="controls">
                <button type="button" class="btn btn-sm  btn-primary ui-pagePost" data-custom-params="url:'@Url.ActionUrl("Update")',validForm:true,callBack:''">提交</button>
                <span class="help-block"></span>
            </div>
        </div>
    </form>
</div>

<script type="text/javascript">
                        //初始化tab插件
                        $(".tabcontent").InitTab();
                        $("#loginTab").FormBind({ bindId: false, fieldPrefix: "Login_", dataSourceFrom: "attr" });
                        $("#regTab").FormBind({ bindId: false, fieldPrefix: "Reg_", dataSourceFrom: "attr" });
                        $("#findPassTab").FormBind({ bindId: false, fieldPrefix: "FindPassword_", dataSourceFrom: "attr" });
                        $("#memberCenterConfig").FormBind({ bindId: false, fieldPrefix: "MemberCenter_", dataSourceFrom: "attr" });
                        $("#adminCenterConfig").FormBind({ bindId: false, fieldPrefix: "AdminCenter_", dataSourceFrom: "attr" });
</script>
